import React from 'react'; 
import logo from '../assets/images/logo.svg'; 

class News2 extends React.Component {
    constructor(props){
        super(props); 

        this.state = {
            msg : '新闻',
            list: ['111111111', '22222222222', '333333333'],
            list2: [<h2 key='1'>我是一个H2</h2>,<h2 key='2'>我是一个H2</h2>],
            list3: [
                {title: '新闻1111111'},
                {title: '新闻2222222'},
                {title: '新闻3333333'}             
            ]
            
        }
    }

    render() {
        let listResult = this.state.list.map(function(value, key){
            return <li key={key}>{value}</li>
        }) 

        return (
            <div className="news">
                <img src = {logo}/>
                <img src = {require('../assets/images/logo.svg')}/>
            
                <br/>
                {this.state.list2}

                <br/>
                <ul>
                    {listResult}
                </ul>

                <br/>
                <ul>
                    {
                        this.state.list3.map(function(value, key){
                            return (<li key={key}>{value.title}</li>);
                        })
                    }
                </ul>
            
            </div>

        )
    }
}

export default News2